﻿<!--#include file="utf-8.asp"-->
<!--#include file="conn.asp"-->
<!--#include file="seeion.asp"--> 
<%

id=request.form("id")
Title=request.form("Title")
Descriptions=request.form("Descriptions")
SortID=request.form("SortID")
Content=request.form("Content")

if request.form("Elite") = "on" then
	Elite=1
else
	Elite=0
end if

if request("type") = "add" then
	set rs=server.createobject("adodb.recordset")
	sql="select * from job"
	rs.open sql,conn,1,3
	call panduan()
	rs.addnew
	rs("title")=title
	rs("Descriptions")=Descriptions
	rs("SortID")=SortID
	rs("Content")=Content
	rs("Elite")=Elite
	rs("UpdateTime")=now()
	rs.update
	Response.Write "<script>alert('添加职位成功！点击 [确定] 继续添加！');window.location.href='admin_job.asp';</script>" 
else
	sql="select * from job where id="&request("id")&""
	set rs=server.createobject("adodb.recordset")
	rs.open SQL,conn,2,3
	if rs.eof and rs.bof then
		Response.Write "<script language='javascript'>alert('参数错误!');document.location.href('Manage_news.asp');</script>"
		Response.End()
	end if
	call panduan()
	rs("title")=title
	rs("Descriptions")=Descriptions
	rs("SortID")=SortID
	rs("Content")=Content
	rs("Elite")=Elite
	rs("UpdateTime")=now()
	rs.update 
	response.write "<script>alert('修改职位成功！点击 [确定] 返回职位管理');window.location.href='admin_job.asp?type=update&id="&request("id")&"';</script>" 
end if
rs.close
set rs=nothing
conn.close
set rs=nothing

function panduan()
	if title=""  then 
		response.Write("<script language=javascript>alert('中文职位标题不能为空!');history.go(-1)</script>") 
		response.end 
	end if
	if Content="" then 
		response.Write("<script language=javascript>alert('中文职位内容不能为空!');history.go(-1)</script>") 
		response.end 
	end if
end function
%>
